package exercises;

/**
 * @author zerorain
 **/
import java.util.*;
//字符串中找出连续最长的数字串  灵活使用toCharArray或者CharAt 用临时temp存放 ret作为结果返回
public class ex6 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String temp = "";
        String ret = "";
        char[] arr = str.toCharArray();
        for(int i = 0; i < arr.length; i++){
            if('0' <= arr[i] && arr[i] <= '9'){
                temp += arr[i];
            } else{
                if(temp.length() > ret.length()){
                    ret = temp;
                    temp = "";
                } else{
                    temp = "";
                }
            }
            if(i == str.length() - 1 && temp.length() > ret.length()){
                ret = temp;
            }
        }
        System.out.println(ret);

    }
}